package com.kly.sc.api.application.enums;

import com.google.common.collect.Lists;

import java.util.List;

public enum BenefitsType {
    BROWSE(1,"browse", "浏览用户数"),
    LIKES(2,"likes", "喜欢用户数"),
    ALL_CONVERSATIONS(3,"all conversations","会话总"),
    FIRST_CONVERSATIONS(4,"first conversations","破冰会话数"),
    EFFECTIVE_CONVERSATIONS(5,"effective conversations","有效会话数"),
    DEEP_CONVERSATIONS(6,"deep conversations","深度会话数"),
    FLASHCHAT(7,"flashchtat","flash数"),
    PRIVATE_ALBUMS(8,"private albums","私密相册管理"),
    PRIVATE_PHOTO(9,"private photo","私密相册管理"),
    PRIVATE_VIDEO(10,"private video","私密相册管理"),
    ;
    private Integer code;
    private String name;
    private String description;

    public static BenefitsType fromType(Integer code) {
        for (BenefitsType benefitsType : values()) {
            if (benefitsType.getCode().equals(code)) {
                return benefitsType;
            }
        }
        return null;
    }

    public static List<BenefitsType> getAllBenefits() {
        List<BenefitsType> benefitsTypeList = Lists.newArrayList();
        for (BenefitsType benefitsType : values()) {
            benefitsTypeList.add(benefitsType);
        }
        return benefitsTypeList;
    }

    BenefitsType(Integer limit, String name, String description) {
        this.code = limit;
        this.name = name;
        this.description = description;
    }

    public Integer getCode() {
        return code;
    }

    public void setCode(Integer code) {
        this.code = code;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }
}
